package com.company.hrmadmin.modules.controller;

import com.company.hrmadmin.common.constant.Result;
import com.company.hrmadmin.modules.entity.vo.CompanyVO;
import com.company.hrmadmin.modules.service.CompanyService;
import com.company.hrmadmin.modules.service.IndustryService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Song, Wei
 * Date: 2022/4/19 19:47
 */
@Slf4j
@RestController
@RequestMapping("/com")
public class CompanyController {

    @Autowired
    private CompanyService companyService;
    @Autowired
    private IndustryService industryService;

    @RequestMapping(path = "/detail", method = RequestMethod.GET)
    public Result<CompanyVO> getCompanyInfo(Integer userId) {
        log.info("获取当前公司信息，参数：{}", userId);
        return Result.success(companyService.getCompanyVO(userId));
    }

    @GetMapping("/industry/list")
    public Result<?> getIndustryList() {
        log.info("获取行业列表信息");
        return Result.success(industryService.getIndustryList());
    }

}
